#ifndef SINK_H
#define SINK_H

#include "Signal.h"
#include <vector>
using namespace std;
// -----------------------------------------------------------
class Sink_ToFile:public block
{
	string FileName;
	int mode; // 0 = save average,1 = save average and detailed
	int repeated;
	vector<double> time;
	vector<double> value;
	vector<double> value2;
	double t_end;
	double dt;
	int    t_idx;
	int    t_node;
	ofstream fout_avg;
	ofstream fout_detail;
public:
	Sink_ToFile(const string FileName,const double it_end,const double idt,const int imode=0);
	~Sink_ToFile();
	virtual void update(const double itime,const double ivalue);
	virtual void update(double sysTime);
	void reset();
};
// -----------------------------------------------------------
class Sink_ToFile_vector:public block
{
	string FileName;
	ofstream fout;
public:
	Sink_ToFile_vector(const string FileName,const double idt,const int iInputDim);
	~Sink_ToFile_vector();
	virtual void update(double sysTime);
};
// -----------------------------------------------------------
class Sink_ToDatabase
{
};
// -----------------------------------------------------------
#endif

